/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author hancing
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface DpKecheng extends BasicModel<DpKecheng> {
  kctype?: string; // 分类
  typename?: string; // 分类名称
  kctitle?: string; // 标题
  kcimg?: string; // kcimg
  kcjianjie?: string; // kcjianjie
  dengji?: number; // 星级
  tags?: string; // 标签
  basesell?: number; // 售出基数
  price?: number; // 价格
  realsell?: number; // 真实销量
  kcdetail?: string; // 课程详情
  kcstatus?: string; // 课程状态
  baiduurl?: string; // 下载地址
}

export const dpKechengList = (params?: DpKecheng | any) =>
  defHttp.get<DpKecheng>({ url: adminPath + '/dp/kecheng/dpKecheng/list', params });

export const dpKechengListData = (params?: DpKecheng | any) =>
  defHttp.post<Page<DpKecheng>>({ url: adminPath + '/dp/kecheng/dpKecheng/listData', params });

export const dpKechengForm = (params?: DpKecheng | any) =>
  defHttp.get<DpKecheng>({ url: adminPath + '/dp/kecheng/dpKecheng/form', params });

export const dpKechengSave = (params?: any, data?: DpKecheng | any) =>
  defHttp.postJson<DpKecheng>({ url: adminPath + '/dp/kecheng/dpKecheng/save', params, data });

export const dpKechengDelete = (params?: DpKecheng | any) =>
  defHttp.get<DpKecheng>({ url: adminPath + '/dp/kecheng/dpKecheng/delete', params });
